<%--
  Created by IntelliJ IDEA.
  User: TT
  Date: 2020/10/23
  Time: 16:58
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <link rel="stylesheet" href="css/index2.css">
    <script type="text/javascript" src="js/jquery-1.8.2.min.js"></script>
    <script type="text/javascript">
    $(function () {
        $.post("idlist",{"sid":${param.sid}},function (num){
            $("[name=sno]").val(num.sno);
            $("[name=sname]").val(num.sname);
            $("[name=sex][value='"+num.sex+"']").prop("checked",true);
            $("[name=birthday]").val(num.birthday);
            $("[name=category]").val(num.category);
            $("[name=subject]").val(num.subject);
            $("[name=school]").val(num.school);

            $.post("huixian",function (number) {
                for (var i in number){
                   if (num.cid==number[i].cid){
                       $("#f").append("<option value='"+number[i].cid+"' selected>"+number[i].cname+"</option>")
                   }else {
                       $("#f").append("<option value='"+number[i].cid+"'>"+number[i].cname+"</option>")
                   }
                }
            },"json");

        },"json");
    })
    </script>
</head>
<body>
<form method="post" action="update">
    <input type="hidden" name="sid" value="${param.sid}">
    学生学号:<input type="text" name="sno"><br>
    学生姓名:<input type="text" name="sname"><br>
    学生性别:<input type="radio" name="sex" value="男">男
    <input type="radio" name="sex" value="女">女<br>
    出生日期:<input type="date" name="birthday"><br>
    类别:<select name="category">
    <option value="城市应届">城市应届</option>
    <option value="城市往届">城市往届</option>
    <option value="农村应届">农村应届</option>
    <option value="农村往届">农村往届</option>
</select><br>
    学科:<select name="subject">
    <option value="理工">理工</option>
    <option value="文史">文史</option>
</select><br>
    所在学校:<input type="text" name="school"><br>
    加分类型:<select name="cid" id="f">
</select>
    <input type="submit" value="提交">
</form>
</body>
</html>
